package com.lepu.app.fun.chat.business.uiflow;

import org.w3c.dom.Element;

/**
 * Created by chuanyhu on 2014/8/9.
 */
public class GoAction {

    private String name;

    private String kind;

    private String target;

    private String containerActivity;



    public void init(Element goele, String defPackage) {
        String attrtarget = goele.getAttribute("target");
        this.target = attrtarget.startsWith(".") ?  defPackage+attrtarget :attrtarget;

        this.kind = goele.getAttribute("kind");
        this.name = goele.getAttribute("name");
        String atrtrContainerActivity = goele.getAttribute("container-activity");
        if(atrtrContainerActivity.length() > 0){
            containerActivity = atrtrContainerActivity;
        }else {
            containerActivity=null;
        }
    }

    public String getName() {
        return name;
    }

    public String getKind() {
        return kind;
    }

    public String getTarget() {
        return target;
    }


    public String getContainerActivity() {
        return containerActivity;
    }

//    private int getResouceId(String containerviewId){
//        AppContext appContext = AppContext.getAppContext();
//        Resources res= appContext.getResources();
//        int id=res.getIdentifier(containerviewId,"id",appContext.getPackageName());
//        return id;
//    }
}
